<!--内容区-->
<form [nzLayout]="'inline'" nz-form class="ant-advanced-search-form">
    <!--
      <nz-form-item>
        <nz-form-label>{{l('keyword')}}</nz-form-label>
        <nz-form-control>
          <nz-input-group nzSuffixIcon="anticon">
            <input type="text" nz-input [(ngModel)]="routeParams.keyWord" [ngModelOptions]="{standalone: true}"
              [placeholder]="l('please_enter_keyword')">
          </nz-input-group>
        </nz-form-control>
      </nz-form-item> -->
      <nz-form-item>
        <nz-form-label>{{l('lockset_no')}}</nz-form-label>
        <nz-form-control>
          <nz-select name="lockCode" [(ngModel)]="routeParams.lockCode">
            <nz-option nzValue="" [nzLabel]="l('all')"></nz-option>
            <nz-option *ngFor="let option of locks" [nzValue]="option.lockNo" [nzLabel]="option.lockNo"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label>{{l('container_no')}}</nz-form-label>
        <nz-form-control>
          <nz-select name="containerCode" [(ngModel)]="routeParams.containerCode">
            <nz-option nzValue="" [nzLabel]="l('all')"></nz-option>
            <nz-option *ngFor="let option of containers" [nzValue]="option.containerNo" [nzLabel]="option.containerNo"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label>{{l('warn_type')}}</nz-form-label>
        <nz-form-control>
          <nz-select name="warnType" [(ngModel)]="routeParams.warnType">
            <nz-option nzValue="" [nzLabel]="l('all')"></nz-option>
            <nz-option nzValue="1" [nzLabel]="l('warn_disassemble_bonnet')"></nz-option>
            <nz-option nzValue="2" [nzLabel]="l('warn_lever_shearing')"></nz-option>
            <nz-option nzValue="3" [nzLabel]="l('warn_lvd')"></nz-option>
            <nz-option nzValue="4" [nzLabel]="l('warn_overspeed')"></nz-option>
            <nz-option nzValue="5" [nzLabel]="l('warn_gps_lost')"></nz-option>
            <nz-option nzValue="6" [nzLabel]="l('warn_long_time')"></nz-option>
            <nz-option nzValue="7" [nzLabel]="l('warn_route_deviation')"></nz-option>
            <nz-option nzValue="8" [nzLabel]="l('warn_park_long_time')"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label>{{l('date_time')}}</nz-form-label>
        <nz-form-control>
          <nz-range-picker [(ngModel)]="dateRange" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)"></nz-range-picker>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label>{{l('start_site')}}</nz-form-label>
        <nz-form-control>
          <nz-select name="site" [(ngModel)]="routeParams.siteId" (ngModelChange)="routeParams.siteId=$event;getPathBySite()">
            <nz-option nzValue="" [nzLabel]="l('all')"></nz-option>
            <nz-option *ngFor="let option of sites" [nzValue]="option.id" [nzLabel]="option.siteName"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label>{{l('path_no')}}</nz-form-label>
        <nz-form-control>
          <nz-select name="routeId" [(ngModel)]="routeParams.routeId">
            <nz-option nzValue="" [nzLabel]="l('all')"></nz-option>
            <nz-option *ngFor="let option of pathList" [nzValue]="option.id" [nzLabel]="option.pathNo"></nz-option>
          </nz-select>
        </nz-form-control>
      </nz-form-item>
    <nz-form-item class="control-area">
      <button nz-button [nzType]="'primary'" (click)="load()">{{l('search')}}</button>
      <button nz-button (click)="reset()">{{l('reset')}}</button>
      <button nz-button (click)="getList()">{{l('refresh')}}</button>
    </nz-form-item>
</form>

<nz-table #ajaxTable nzShowSizeChanger nzBordered [nzScroll]="{x:'1300px'}" [nzFrontPagination]="false" [nzData]="tableHelper.items"
  [nzLoading]="tableHelper.loading" [nzTotal]="tableHelper.totalCount" [(nzPageIndex)]="tableHelper.pageIndex" [nzShowTotal]="totalTemplate"
  [(nzPageSize)]="tableHelper.pageSize" (nzPageIndexChange)="load()" (nzPageSizeChange)="load()">
  <thead>
    <tr>
      <th nzWidth="100px" nzLeft="0px">{{l('serial_number')}}</th>
      <th>{{l('lockset_no')}}</th>
      <th>{{l('container_no')}}</th>
      <th>{{l('path_no')}}</th>
      <th>{{l('car_no')}}</th>
      <th>{{l('start_site')}}</th>
      <th>{{l('end_site')}}</th>
      <!-- <th>{{l('warn_type')}}</th> -->
      <th>{{l('state_info')}}</th>
      <th>{{l('warn_date')}}</th>
      <th>{{l('handler')}}</th>
      <th>
        {{l('handle_state')}}
      </th>
      <th>{{l('notice_state')}}</th>
      <th>{{l('warn_location')}}</th>
      <th nzWidth="140px" nzRight="0px">{{l('operation')}}</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of ajaxTable.data;let i = index">
      <td nzLeft="0px">{{i++1}}</td>
      <td>{{data.lockCode}}</td>
      <td>{{data.containerCode}}</td>
      <td>{{data.routeCode}}</td>
      <td>{{data.transportCode}}</td>
      <td>{{data.launchsiteName}}</td>
      <td>{{data.destinationsiteName}}</td>
      <!-- <td>{{l(data.warnTypeName)}}</td> -->
      <td>{{data.msg}}</td>
      <td>{{data.warnTime|momentFormat:'YYYY-MM-DD HH:mm:ss'}}</td>
      <td>{{data.handleUserName}}</td>
      <td>
        <span *ngIf="data.handleFlag">{{l("already_handle")}}</span>
        <span *ngIf="!data.handleFlag">{{l('wait_handle')}}</span>

      </td>
      <td>
        <span *ngIf="data.noticestatus==0">{{l('uninformed')}}</span>
        <span *ngIf="data.noticestatus==1">{{l('notify_success')}}</span>
        <span *ngIf="data.noticestatus==2">{{l('notify_failed')}}</span>
      </td>
      <td><a (click)="showAddress(data.id)">{{l('view_address')}}</a></td>
      <td nzRight="0px">
        <a (click)="showMessage(data)" *ngIf="data.noticestatus!=1">{{l('send_message')}}</a>

        <a (click)="showReportModal(data.id)" *ngIf="data.noticestatus==1&&data.handleFlag==false">{{l('write_handle_report')}}</a>

        <a (click)="showReportModal(data.id,data.handlereport)" *ngIf="data.noticestatus==1&&data.handleFlag==true">{{l('view_handle_report')}}</a>
      </td>
    </tr>
  </tbody>
</nz-table>

<ng-template #totalTemplate let-total>
  {{l('total')}} {{total}} {{l('items')}}
</ng-template>
<app-report-warn-modal #reportWarnModal (modalSave)="load()"></app-report-warn-modal>
<app-report-address-modal #reportAddressModal></app-report-address-modal>
<app-send-message-modal #sendMessageModal (modalSave)="load()"></app-send-message-modal>
